#include <iostream>

#include <QtGui/QApplication>
#include "mainwindow.h"
#include "Physical/generator.h"
#include "Physical/pwrPlant.h"

using namespace physical;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    //         Fuel    A       B       C       D         Min  Max  Up   Down Cost    Starting
    // Gen1    6.20    3.4     13.6   0.0      0.0       0    50   3    3    63      Off 9
    // Gen2    4.85    2.6     14.2   0.0      0.0       0    50   3    3    38      Off 9
    // Gen3    4.40    4.2     16.0   0.0      0.0       0    25   3    3    55      Off 9
    // Gen4    6.50    319.58  9.073  0.00309  0.000003  150  450  6    9    18,000  On  9
    // Gen5    6.55    319.58  9.073  0.00309  0.000003  150  450  6    9    18,000  On  9
    // Gen6    6.42    319.58  9.073  0.00309  0.000003  150  450  6    9    18,000  On  9
    // Gen7    6.40    319.58  9.073  0.00309  0.000003  150  450  6    9    18,000  Off 9
    // Gen8    5.70    121.07  10.13  0.00531  0.000037  50   180  6    6    4,100   Off 9
    // Gen9    6.00    121.07  10.13  0.00531  0.000037  50   180  6    6    4,300   Off 3
    // Gen10   4.81    101.3   11.02  0.00618  0.00021   30   70   3    6    1,500   Off 3


    float* prodcurve = new float[2];
    prodcurve[0] = 3.4;
    prodcurve[1] = 13.6;
    generator* GEN1 = new generator( 1, prodcurve, 0.0, 50.0, 3.0, 3.0, 63.0 );

    float* prodcurve2 = new float[2];
    prodcurve2[0] = 2.6;
    prodcurve2[1] = 14.2;
    generator* GEN2 = new generator( 1, prodcurve2, 0.0, 50.0, 3.0, 3.0, 38.0 );

    float* prodcurve3 = new float[2];
    prodcurve3[0] = 4.2;
    prodcurve3[1] = 16.0;
    generator* GEN3 = new generator( 1, prodcurve3, 0.0, 50.0, 3.0, 3.0, 55.0 );

    pwrPlant* PLANT1 = new pwrPlant(5.15);
    PLANT1->addGenerator(GEN1);
    PLANT1->addGenerator(GEN2);
    PLANT1->addGenerator(GEN3);

    if (PLANT1->setPlantOutput(150))
    {
        // TEMP
        std::cout << "SUCCESS!!!!" << std::endl;
    }

    PLANT1->printPlantInfo();

    //delete PLANT1;
    delete GEN1;
    delete GEN2;
    delete GEN3;
    delete [] prodcurve;
    delete [] prodcurve2;
    delete [] prodcurve3;

    return a.exec();
}
